import java.util.Scanner;

public class test_4_22 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int num = 0;
        for (int i = 1; i <= n; i++) {
            int ret = 1;
            for (int j = 1; j <= i; j++) {
                ret *=j;
            }
            num += ret;
        }
        System.out.println(num);
    }
    public static void main2(String[] args) {
        int i = 1;
        while (i <= 100) {
            if(i % 15==0) {
                System.out.println(i);
                i++;
                continue;
            }
            i++;
        }
    }
    public static void main1(String[] args) {
        int i = 1;
        while (i <= 10) {
            if(i == 3)
            {
                i++;
                continue;
            }
            System.out.print(i + " ");
            i++;
        }
    }
}
